Skip to content

Commit

Permalink
rename library to avoid double "lib", only enable testing if PROJECT_…
Browse files Browse the repository at this point in the history
…IS_TOP_LEVEL
  • Loading branch information
patrickbr committed Oct 9, 2024
1 parent 0efe6ba commit bc41023
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ if (CMAKE_BUILD_TYPE)
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
endif()

enable_testing()
if(PROJECT_IS_TOP_LEVEL)
enable_testing()
endif()

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/build")
Expand Down Expand Up @@ -36,7 +38,6 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.8 or greater!")
endif ()
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
else ()
message(FATAL_ERROR "Your C++ compiler does not support C++14.")
Expand Down
4 changes: 2 additions & 2 deletions src/spatialjoin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ include_directories(
)

add_executable(spatialjoin ${spatialjoin_main})
add_library(libspatialjoin ${SPATIALJOIN_SRC})
add_library(spatialjoin-dev ${SPATIALJOIN_SRC})

target_link_libraries(spatialjoin libspatialjoin util ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} -lpthread)
target_link_libraries(spatialjoin spatialjoin-dev util ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} -lpthread)

add_subdirectory(tests)
2 changes: 1 addition & 1 deletion src/spatialjoin/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
add_executable(spatialjoinTest TestMain.cpp)
target_link_libraries(spatialjoinTest libspatialjoin util ${BZIP2_LIBRARIES} -lpthread)
target_link_libraries(spatialjoinTest spatialjoin-dev util ${BZIP2_LIBRARIES} -lpthread)

0 comments on commit bc41023

Please sign in to comment.