From 7fa66b18166bb2cfb8a5fc961fdad8724d848591 Mon Sep 17 00:00:00 2001 From: eidheim Date: Mon, 11 Jul 2016 13:11:54 +0200 Subject: [PATCH] Cleanup of the CMakeLists.txt files --- CMakeLists.txt | 16 ++++++++++++++++ src/CMakeLists.txt | 21 --------------------- tests/CMakeLists.txt | 13 ------------- 3 files changed, 16 insertions(+), 34 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 095bb4b..2788207 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,9 @@ if(APPLE) set(CMAKE_MACOSX_RPATH 1) set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig") endif() +if(${CMAKE_SYSTEM_NAME} MATCHES FreeBSD) + link_directories(/usr/local/lib) +endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules/") find_package(LibClang REQUIRED) @@ -54,6 +57,19 @@ pkg_check_modules(GTKMM gtkmm-3.0 REQUIRED) pkg_check_modules(GTKSVMM gtksourceviewmm-3.0 REQUIRED) pkg_check_modules(LIBGIT2 libgit2 REQUIRED) +if(MSYS) + set(global_libraries winpthread) +endif() +set(global_libraries ${global_libraries} + ${GTKMM_LIBRARIES} + ${GTKSVMM_LIBRARIES} + ${Boost_LIBRARIES} + ${LIBCLANG_LIBRARIES} + ${LIBLLDB_LIBRARIES} + ${ASPELL_LIBRARIES} + ${LIBGIT2_LIBRARIES} +) + add_subdirectory("src") #TODO: instead of the if-expression below, disable tests on Travis CI for clang++ builds diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ad2ca9e..1c41594 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,26 +14,6 @@ set(global_includes . ) -if(MSYS) - set(global_libraries winpthread) -endif() -set(global_libraries ${global_libraries} - ${GTKMM_LIBRARIES} - ${GTKSVMM_LIBRARIES} - ${Boost_LIBRARIES} - ${LIBCLANG_LIBRARIES} - ${LIBLLDB_LIBRARIES} - ${ASPELL_LIBRARIES} - ${LIBGIT2_LIBRARIES} -) - -if (${CMAKE_SYSTEM_NAME} MATCHES FreeBSD) - set(global_link_directories /usr/local/lib) -endif() -set(global_link_directories - ${Boost_LIBRARY_DIRS} -) - set(project_files config.cc dialogs.cc @@ -93,7 +73,6 @@ else() endif() include_directories(${global_includes}) -link_directories(${global_link_directories}) add_library(project_shared OBJECT ${project_shared_files}) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8ce6d00..22d1062 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -12,19 +12,6 @@ set(global_includes ../src ) -if(MSYS) - set(global_libraries winpthread) -endif() -set(global_libraries ${global_libraries} - ${GTKMM_LIBRARIES} - ${GTKSVMM_LIBRARIES} - ${Boost_LIBRARIES} - ${LIBCLANG_LIBRARIES} - ${LIBLLDB_LIBRARIES} - ${ASPELL_LIBRARIES} - ${LIBGIT2_LIBRARIES} -) - set(stub_files stubs/config.cc stubs/dialogs.cc