diff options
author | Arnur Nigmetov <anigmetov@lbl.gov> | 2022-04-09 17:33:15 -0700 |
---|---|---|
committer | Arnur Nigmetov <anigmetov@lbl.gov> | 2022-04-09 17:33:15 -0700 |
commit | 8fbae1d789b3c9d7e9b079284c85489d8dcd7e65 (patch) | |
tree | c884ea100a702c7a6cb1cef083168ed59d7e0f31 /wasserstein/CMakeLists.txt | |
parent | e62d16d7b1c42163de7b21ab74a780c3c1cf8e45 (diff) |
Major cleanupupstream/latest
Diffstat (limited to 'wasserstein/CMakeLists.txt')
-rw-r--r-- | wasserstein/CMakeLists.txt | 59 |
1 files changed, 11 insertions, 48 deletions
diff --git a/wasserstein/CMakeLists.txt b/wasserstein/CMakeLists.txt index dea4550..0a0fa4e 100644 --- a/wasserstein/CMakeLists.txt +++ b/wasserstein/CMakeLists.txt @@ -1,62 +1,25 @@ -project (wasserstein) -cmake_minimum_required (VERSION 3.5.1) +project(wasserstein) +cmake_minimum_required(VERSION 3.5.1) -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -include (GenerateExportHeader) - -include(TestBigEndian) -test_big_endian(BIG_ENDIAN) -if(BIG_ENDIAN) - add_definitions(-DBIGENDIAN) -endif() - -# Default to Release - -if (NOT CMAKE_BUILD_TYPE) - set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") -endif (NOT CMAKE_BUILD_TYPE) +endif(NOT CMAKE_BUILD_TYPE) # Boost -find_package (Boost) -include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include - SYSTEM ${Boost_INCLUDE_DIR}) - -if(NOT WIN32) - add_definitions(-std=c++14) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb -D_GLIBCXX_DEBUG") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 ") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -O2 -g -ggdb") -endif(NOT WIN32) +find_package(Boost) -file(GLOB WS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp) - -#add_library(wasserstein ${WS_SOURCES}) - -#if (WIN32) - #GENERATE_EXPORT_HEADER(wasserstein - #BASE_NAME wasserstein - #EXPORT_MACRO_NAME wasserstein_EXPORT - #EXPORT_FILE_NAME wasserstein_export.h - #STATIC_DEFINE wasserstein_BUILT_AS_STATIC) -#endif(WIN32) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include SYSTEM ${Boost_INCLUDE_DIR}) find_package (Threads) set (libraries ${libraries} ${CMAKE_THREAD_LIBS_INIT}) -add_executable(wasserstein_dist ${CMAKE_CURRENT_SOURCE_DIR}/example/wasserstein_dist.cpp ${WS_HEADERS} include/hera_infinity.h) -target_link_libraries(wasserstein_dist PUBLIC ${libraries}) - -add_executable(wasserstein_dist_dipha ${CMAKE_CURRENT_SOURCE_DIR}/example/wasserstein_dist_dipha.cpp ${WS_HEADERS} include/hera_infinity.h) -target_link_libraries(wasserstein_dist_dipha PUBLIC ${libraries}) - -# pure geometric version, arbitrary dimension -add_executable(wasserstein_dist_point_cloud ${CMAKE_CURRENT_SOURCE_DIR}/example/wasserstein_dist_point_cloud.cpp ${WS_HEADERS} include/hera_infinity.h) -target_link_libraries(wasserstein_dist_point_cloud PUBLIC ${libraries}) +add_subdirectory(example) +#add_subdirectory(tests) # Tests add_executable(wasserstein_test ${CMAKE_CURRENT_SOURCE_DIR}/tests/tests_main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_hera_wasserstein.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_hera_wasserstein_pure_geom.cpp include/hera_infinity.h tests/tests_reader.h) -#add_executable(wasserstein_test EXCLUDE_FROM_ALL ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_hera_wasserstein.cpp) target_link_libraries(wasserstein_test PUBLIC ${libraries}) |