From dc68397e4862e76c92ba99c27bbc23868e015e61 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Wed, 29 Dec 2010 18:12:44 +0100 Subject: [PATCH] cmake improvements for shared library build --- CMakeModules/SimGearComponent.cmake | 2 +- simgear/CMakeLists.txt | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeModules/SimGearComponent.cmake b/CMakeModules/SimGearComponent.cmake index 15055628..3eb5740a 100644 --- a/CMakeModules/SimGearComponent.cmake +++ b/CMakeModules/SimGearComponent.cmake @@ -1,7 +1,7 @@ macro(simgear_component name includePath sources headers) - if (${SIMGEAR_SHARED}) + if (SIMGEAR_SHARED) foreach(s ${sources}) set_property(GLOBAL APPEND PROPERTY ALL_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${s}") diff --git a/simgear/CMakeLists.txt b/simgear/CMakeLists.txt index 3f6f03c5..d78e6f94 100644 --- a/simgear/CMakeLists.txt +++ b/simgear/CMakeLists.txt @@ -38,18 +38,20 @@ install (FILES ${HEADERS} DESTINATION include/simgear/) if(SIMGEAR_SHARED) message(STATUS "building shared library") get_property(allSources GLOBAL PROPERTY ALL_SOURCES) - get_property(publicHeaders GLOBAL PROPERTY PUBLIC_HEADERS) + get_property(publicHeaders GLOBAL PROPERTY PUBLIC_HEADERS) add_library(SimGear SHARED ${allSources}) set_property(TARGET SimGear PROPERTY FRAMEWORK 1) - message(STATUS "public header: ${publicHeaders}") - set_property(TARGET SimGear PROPERTY PUBLIC_HEADER "${publicHeaders}") + message(STATUS "public header: ${publicHeaders}") + set_property(TARGET SimGear PROPERTY PUBLIC_HEADER "${publicHeaders}") + set_property(TARGET SimGear PROPERTY LINKER_LANGUAGE CXX) target_link_libraries(SimGear ${ZLIB_LIBRARY} ${OPENSCENEGRAPH_LIBRARIES} ${OPENAL_LIBRARY} ${ALUT_LIBRARY} ${OPENGL_LIBRARY}) - install() + install(TARGETS SimGear LIBRARY DESTINATION lib${LIB_SUFFIX} + PUBLIC_HEADER DESTINATION include/simgear) endif(SIMGEAR_SHARED) - \ No newline at end of file + -- 2.39.5