]> git.mxchange.org Git - simgear.git/commitdiff
cmake improvements for shared library build
authorTim Moore <timoore33@gmail.com>
Wed, 29 Dec 2010 17:12:44 +0000 (18:12 +0100)
committerTim Moore <timoore33@gmail.com>
Wed, 29 Dec 2010 17:12:44 +0000 (18:12 +0100)
CMakeModules/SimGearComponent.cmake
simgear/CMakeLists.txt

index 15055628dbb7251cdadb1ef1a01bf6330afd1c11..3eb5740acc5937d4b2ab1600e08a3419d817bc9e 100644 (file)
@@ -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}")
index 3f6f03c59b80e1f3a67e778e3b957912b6483a6a..d78e6f947746ee9c2861cb504b2de92ec0554ede 100644 (file)
@@ -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
+