aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-03-25 14:31:42 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-03-25 14:31:42 -0700
commit24a1ab461b9fd24b632f18734c4270972e481b4f (patch)
treec6c36c450a134da243012b25fda95e6a60511c76
parent5bf23381e0dbf56aea19e646cf371d1d3ee80ada (diff)
downloadsubsurface-24a1ab461b9fd24b632f18734c4270972e481b4f.tar.gz
cmake cleanup
- don't reference .so files, reference libraries - handle libdivecomputer just like the other libraries - add the ability to link libdivecomputer statically Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--CMakeLists.txt18
1 files changed, 12 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c1d86caef..0752ceef5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,18 +28,25 @@ ELSE()
include_directories(${LIBGIT2DEVEL}/include)
link_directories(${LIBGIT2DEVEL}/build)
if(LIBGIT2STATIC STREQUAL "")
- set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} libgit2.so libssl.so libcrypto.so)
+ set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -lgit2 -lssl -lcrypto)
ELSE()
- set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} libgit2.a libssl.so libcrypto.so)
+ set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} libgit2.a -lssl -lcrypto)
ENDIF()
ENDIF()
pkg_config_library(LIBXSLT libxslt)
SET(LIBDCDEVEL "" CACHE STRING "libraries")
-IF(NOT (LIBDCDEVEL STREQUAL ""))
+IF(DEFINED LIBDCDEVEL)
cmake_policy(SET CMP0015 OLD)
include_directories(${LIBDCDEVEL}/include )
link_directories(${LIBDCDEVEL}/src/.libs)
+ if(LIBDCSTATIC STREQUAL "")
+ set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -ldivecomputer)
+ ELSE()
+ set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} libdivecomputer.a -lusb-1.0)
+ ENDIF()
+ELSE()
+ set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -ldivecomputer)
ENDIF()
STRING(COMPARE EQUAL "${${PROJECT_NAME}_SOURCE_DIR}" "${${PROJECT_NAME}_BINARY_DIR}" insource)
@@ -66,7 +73,7 @@ IF(NOT DEFINED LIBMARBLEDEVEL)
INCLUDE_DIRECTORIES(${MARBLE_INCLUDE_DIR})
ELSE()
INCLUDE_DIRECTORIES(${LIBMARBLEDEVEL}/include)
- SET(MARBLE_LIBRARIES ${LIBMARBLEDEVEL}/lib/libssrfmarblewidget.so)
+ SET(MARBLE_LIBRARIES -L${LIBMARBLEDEVEL}/lib -lssrfmarblewidget)
ENDIF()
# Generate the ssrf-config.h every 'make'
@@ -249,7 +256,6 @@ target_link_libraries( subsurface
subsurface_statistics
subsurface_corelib
${SUBSURFACE_LINK_LIBRARIES}
- -ldivecomputer
-lzip
)
@@ -261,7 +267,7 @@ ADD_DEPENDENCIES(subsurface_corelib version)
MACRO(test NAME FILE)
ADD_EXECUTABLE(${NAME} tests/${FILE} ${SUBSURFACE_RESOURCES})
- TARGET_LINK_LIBRARIES(${NAME} subsurface_corelib ${QT_TEST_LIBRARIES} ${SUBSURFACE_LINK_LIBRARIES} -lzip -ldivecomputer)
+ TARGET_LINK_LIBRARIES(${NAME} subsurface_corelib ${QT_TEST_LIBRARIES} ${SUBSURFACE_LINK_LIBRARIES} -lzip )
ADD_TEST(NAME ${NAME} COMMAND ${NAME})
ENDMACRO()