ref: e847abfa04ca6dc058810a4b31cec6ee5d91f94e
parent: 0ac0a6f6b4e93f713fffc4136a4457b951e0432f
author: Azamat H. Hackimov <azamat.hackimov@gmail.com>
date: Tue May 10 06:52:08 EDT 2016
Various fixes for CMake * Fixing installation of header file dumb.h * Fixing installation of Allegro targets * Making FindAllegro more verbose * Using list(APPEND,...) instead set() for simplify code
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -117,7 +117,7 @@
)
set(INSTALL_HEADERS
- ../include/dumb.h
+ include/dumb.h
)
set(ALLEGRO_SOURCES
@@ -139,16 +139,13 @@
add_library(dumb ${SOURCES})
set_target_properties(dumb PROPERTIES DEBUG_POSTFIX d)
-set(ALLEGRO4_TARGETS "")
if(BUILD_ALLEGRO4)
add_library(aldmb ${ALLEGRO_SOURCES})
- set(ALLEGRO4_TARGETS ${ALLEGRO_TARGETS} aldmb)
- set(ALLEGRO4_HEADERS indclude/aldumb.h)
+ list(APPEND DUMB_TARGETS aldmb)
+ list(APPEND INSTALL_HEADERS include/aldumb.h)
target_link_libraries(aldmb ${ALLEGRO_LIBRARIES})
endif()
-set(EXAMPLE_TARGETS "")
-
if(BUILD_EXAMPLES)
add_executable(dumbout examples/dumbout.c)
add_executable(dumbplay examples/dumbplay.c)
@@ -162,7 +159,7 @@
target_link_libraries(dumbplay ${ARGTABLE2_LIBRARY} ${SDL2_LIBRARY} dumb)
include_directories(${ARGTABLE2_INCLUDE_DIR} ${SDL2_INCLUDE_DIR} "examples/")
- set(EXAMPLE_TARGETS ${EXAMPLE_TARGETS} "dumbout" "dumbplay")
+ list(APPEND DUMB_TARGETS "dumbout" "dumbplay")
endif()
# Make sure the dylib install name path is set on OSX so you can include dumb in app bundles
@@ -172,8 +169,8 @@
target_link_libraries(dumb m)
-INSTALL(FILES ${INSTALL_HEADERS} ${ALLEGRO_HEADERS} DESTINATION include/)
-INSTALL(TARGETS dumb ${EXAMPLE_TARGETS}
+INSTALL(FILES ${INSTALL_HEADERS} DESTINATION include/)
+INSTALL(TARGETS dumb ${DUMB_TARGETS}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
--- a/cmake-scripts/FindAllegro4.cmake
+++ b/cmake-scripts/FindAllegro4.cmake
@@ -5,12 +5,6 @@
# ALLEGRO_LIBRARIES - List of libraries when using allegro.
# ALLEGRO_FOUND - True if allegro found.
-
-IF (ALLEGRO_INCLUDE_DIR)
- # Already in cache, be silent
- SET(ALLEGRO_FIND_QUIETLY TRUE)
-ENDIF (ALLEGRO_INCLUDE_DIR)
-
FIND_PATH(ALLEGRO_INCLUDE_DIR allegro.h
/usr/local/include
/usr/include
@@ -35,17 +29,13 @@
ENDIF (ALLEGRO_INCLUDE_DIR AND ALLEGRO_LIBRARY)
IF (ALLEGRO_FOUND)
- IF (NOT ALLEGRO_FIND_QUIETLY)
- MESSAGE(STATUS "Found Allegro: ${ALLEGRO_LIBRARY}")
- ENDIF (NOT ALLEGRO_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Allegro: ${ALLEGRO_LIBRARY}")
ELSE (ALLEGRO_FOUND)
- IF (ALLEGRO_FIND_REQUIRED)
- MESSAGE(STATUS "Looked for Allegro libraries named ${ALLEGRO_NAMES}.")
- MESSAGE(FATAL_ERROR "Could NOT find Allegro library")
- ENDIF (ALLEGRO_FIND_REQUIRED)
+ MESSAGE(STATUS "Looked for Allegro libraries named ${ALLEGRO_NAMES}.")
+ MESSAGE(FATAL_ERROR "Could NOT find Allegro library")
ENDIF (ALLEGRO_FOUND)
MARK_AS_ADVANCED(
ALLEGRO_LIBRARY
ALLEGRO_INCLUDE_DIR
-)
\ No newline at end of file
+)