-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
94 lines (82 loc) · 5.02 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
cmake_minimum_required(VERSION 3.30)
project(MyProject)
find_package(PkgConfig REQUIRED)
# Set the C++ standard to C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Find Eigen3 (make sure you have Eigen installed and CMake can find it)
find_package(Eigen3 3.3 REQUIRED)
# Find Boost (adjust components if you need specific ones like filesystem, system, etc.)
find_package(Boost REQUIRED COMPONENTS serialization)
# Find the GMP library (add REQUIRED to stop if it's not found)
pkg_check_modules(GMP REQUIRED gmpxx)
find_library(GMP_LIBRARY NAMES gmp HINTS ${GMP_LIBRARY_DIRS})
find_library(GMPXX_LIBRARY NAMES gmpxx HINTS ${GMP_LIBRARY_DIRS})
message(STATUS "GMPXX library names: ${GMPXX_LIBRARY}")
# Add include directories (adjust paths to your actual include locations)
include_directories(${EIGEN3_INCLUDE_DIR})
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}/basic_common_cpp/src_basic)
include_directories(${CMAKE_SOURCE_DIR}/basic_common_cpp/src_number)
include_directories(${CMAKE_SOURCE_DIR}/basic_common_cpp/src_matrix)
include_directories(${CMAKE_SOURCE_DIR}/basic_common_cpp/src_comb)
include_directories(${CMAKE_SOURCE_DIR}/basic_common_cpp/src_graph)
include_directories(${CMAKE_SOURCE_DIR}/basic_common_cpp/sparse-map/include/tsl)
include_directories(${CMAKE_SOURCE_DIR}/basic_common_cpp/robin-map/include/tsl)
include_directories(${CMAKE_SOURCE_DIR}/basic_common_cpp/hopscotch-map/include/tsl)
include_directories(${CMAKE_SOURCE_DIR}/src_copos)
include_directories(${CMAKE_SOURCE_DIR}/src_dualdesc)
include_directories(${CMAKE_SOURCE_DIR}/src_group)
include_directories(${CMAKE_SOURCE_DIR}/src_indefinite)
include_directories(${CMAKE_SOURCE_DIR}/src_isotropy)
include_directories(${CMAKE_SOURCE_DIR}/src_perfect)
include_directories(${CMAKE_SOURCE_DIR}/src_short)
include_directories(${CMAKE_SOURCE_DIR}/src_latt)
include_directories(${CMAKE_SOURCE_DIR}/src_lorentzian)
include_directories(${CMAKE_SOURCE_DIR}/src_poly)
include_directories(${CMAKE_SOURCE_DIR}/permutalib/src)
include_directories(${CMAKE_SOURCE_DIR}/src)
include(ExternalProject)
ExternalProject_Add(
NautyDirectPackage
PREFIX "${CMAKE_BINARY_DIR}/external"
GIT_REPOSITORY https://github.com/MathieuDutSik/nauty
GIT_TAG 2.8.9
UPDATE_DISCONNECTED TRUE
CONFIGURE_COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/external/nauty/install
BUILD_IN_SOURCE 1
)
# Grouped the libraries
set(MY_LIBRARIES_GRP ${CMAKE_BINARY_DIR}/external/nauty/install/lib/libnauty.a ${Boost_LIBRARIES} ${GMPXX_LIBRARY} ${GMP_LIBRARY})
set(MY_LIBRARIES ${Boost_LIBRARIES} ${GMPXX_LIBRARY} ${GMP_LIBRARY})
# Add the executable
add_executable(POLY_DirectSerialDualDesc ${CMAKE_SOURCE_DIR}/src_dualdesc/POLY_DirectSerialDualDesc.cpp)
add_executable(CP_TestCopositivity ${CMAKE_SOURCE_DIR}/src_copos/CP_TestCopositivity.cpp)
add_executable(CP_TestCompletePositivity ${CMAKE_SOURCE_DIR}/src_copos/CP_TestCompletePositivity.cpp)
add_executable(LORENTZ_ReflectiveEdgewalk ${CMAKE_SOURCE_DIR}/src_lorentzian/LORENTZ_ReflectiveEdgewalk.cpp)
add_executable(POLY_DirectFaceLattice ${CMAKE_SOURCE_DIR}/src_poly/POLY_DirectFaceLattice.cpp)
add_executable(INDEF_FORM_AutomorphismGroup ${CMAKE_SOURCE_DIR}/src_indefinite/INDEF_FORM_AutomorphismGroup.cpp)
add_executable(INDEF_FORM_TestEquivalence ${CMAKE_SOURCE_DIR}/src_indefinite/INDEF_FORM_TestEquivalence.cpp)
add_executable(INDEF_FORM_GetOrbitRepresentative ${CMAKE_SOURCE_DIR}/src_indefinite/INDEF_FORM_GetOrbitRepresentative.cpp)
add_executable(INDEF_FORM_GetOrbit_IsotropicKplane ${CMAKE_SOURCE_DIR}/src_indefinite/INDEF_FORM_GetOrbit_IsotropicKplane.cpp)
add_executable(LATT_Canonicalize ${CMAKE_SOURCE_DIR}/src_latt/LATT_Canonicalize.cpp)
add_executable(LATT_FindIsotropic ${CMAKE_SOURCE_DIR}/src_isotropy/LATT_FindIsotropic.cpp)
add_executable(LATT_SerialComputeDelaunay ${CMAKE_SOURCE_DIR}/src_latt/LATT_SerialComputeDelaunay.cpp)
add_executable(LATT_SerialLattice_IsoDelaunayDomain ${CMAKE_SOURCE_DIR}/src_latt/LATT_SerialLattice_IsoDelaunayDomain.cpp)
# ---Delaunay polytopes enumeration (Serial)
# ---Iso-Delaunay spacse (Serial)
# Add dependency to your target
target_link_libraries(POLY_DirectSerialDualDesc ${MY_LIBRARIES_GRP})
target_link_libraries(CP_TestCopositivity ${MY_LIBRARIES})
target_link_libraries(CP_TestCompletePositivity ${MY_LIBRARIES})
target_link_libraries(LORENTZ_ReflectiveEdgewalk ${MY_LIBRARIES_GRP})
target_link_libraries(POLY_DirectFaceLattice ${MY_LIBRARIES_GRP})
target_link_libraries(INDEF_FORM_AutomorphismGroup ${MY_LIBRARIES_GRP})
target_link_libraries(INDEF_FORM_TestEquivalence ${MY_LIBRARIES_GRP})
target_link_libraries(INDEF_FORM_GetOrbitRepresentative ${MY_LIBRARIES_GRP})
target_link_libraries(INDEF_FORM_GetOrbit_IsotropicKplane ${MY_LIBRARIES_GRP})
target_link_libraries(LATT_Canonicalize ${MY_LIBRARIES_GRP})
target_link_libraries(LATT_FindIsotropic ${MY_LIBRARIES})
target_link_libraries(LATT_SerialComputeDelaunay ${MY_LIBRARIES_GRP})
target_link_libraries(LATT_SerialLattice_IsoDelaunayDomain ${MY_LIBRARIES_GRP})
target_include_directories(POLY_DirectSerialDualDesc PUBLIC ${GMP_INCLUDE_DIRS})