Explorar o código

Don't build both static and shared libraries

Bastien %!s(int64=6) %!d(string=hai) anos
pai
achega
09d38f3700
Modificáronse 3 ficheiros con 5 adicións e 7 borrados
  1. 3 5
      CMakeLists.txt
  2. 1 1
      examples/opengl/CMakeLists.txt
  3. 1 1
      examples/simple/CMakeLists.txt

+ 3 - 5
CMakeLists.txt

@@ -161,12 +161,10 @@ if (UNIX)
 endif (UNIX)
 
 link_libraries(${LIBS})
-add_library(openhmd-shared SHARED ${openhmd_source_files})
-SET_TARGET_PROPERTIES(openhmd-shared PROPERTIES OUTPUT_NAME openhmd CLEAN_DIRECT_OUTPUT 1 VERSION ${LIB_VERSION_STRING} SOVERSION ${LIB_VERSION_MAJOR})
-add_library(openhmd-static STATIC ${openhmd_source_files})
-SET_TARGET_PROPERTIES(openhmd-static PROPERTIES OUTPUT_NAME openhmd CLEAN_DIRECT_OUTPUT 1)
+add_library(openhmd ${openhmd_source_files})
+SET_TARGET_PROPERTIES(openhmd PROPERTIES VERSION ${LIB_VERSION_STRING} SOVERSION ${LIB_VERSION_MAJOR})
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_DIR}/)
 
 #install properties
-install (TARGETS openhmd-shared openhmd-static DESTINATION lib)
+install (TARGETS openhmd DESTINATION lib)
 install (FILES include/openhmd.h DESTINATION include)

+ 1 - 1
examples/opengl/CMakeLists.txt

@@ -2,4 +2,4 @@ project (openglexample)
 include_directories(${CMAKE_BINARY_DIR}/include ${SDL2_INCLUDE_DIR} ${GLEW_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR})
 link_directories(${CMAKE_BINARY_DIR})
 add_executable(openglexample gl.c main.c)
-target_link_libraries(openglexample PRIVATE openhmd-shared m ${SDL2_LIBRARY} ${GLEW_LIBRARIES} ${OPENGL_LIBRARIES})
+target_link_libraries(openglexample PRIVATE openhmd m ${SDL2_LIBRARY} ${GLEW_LIBRARIES} ${OPENGL_LIBRARIES})

+ 1 - 1
examples/simple/CMakeLists.txt

@@ -2,4 +2,4 @@ project (simple)
 include_directories(${CMAKE_BINARY_DIR}/include)
 link_directories(${CMAKE_BINARY_DIR})
 add_executable(simple simple.c)
-target_link_libraries(simple PRIVATE openhmd-shared m)
+target_link_libraries(simple PRIVATE openhmd m)