ReducedModelOptimization/CMakeLists.txt

93 lines
3.4 KiB
CMake
Raw Normal View History

2020-11-23 10:06:45 +01:00
cmake_minimum_required(VERSION 2.8)
project(ReducedModelOptimization)
#Add the project cmake scripts to the module path
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
#Download external dependencies NOTE: If the user has one of these libs it shouldn't be downloaded again.
include(${CMAKE_MODULE_PATH}/DownloadProject.cmake)
if (CMAKE_VERSION VERSION_LESS 3.2)
set(UPDATE_DISCONNECTED_IF_AVAILABLE "")
else()
set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")
endif()
2020-12-17 21:34:49 +01:00
##Create directory for the external libraries
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build/external)
2020-11-23 10:06:45 +01:00
##matplot++ lib
download_project(PROJ MATPLOTPLUSPLUS
GIT_REPOSITORY https://github.com/alandefreitas/matplotplusplus
GIT_TAG master
2020-12-17 21:34:49 +01:00
PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/build/external/
2020-11-23 10:06:45 +01:00
${UPDATE_DISCONNECTED_IF_AVAILABLE}
)
add_subdirectory(${MATPLOTPLUSPLUS_SOURCE_DIR})
2021-02-04 15:06:39 +01:00
set(MYSOURCES_SOURCE_DIR "/home/iason/Coding/Libraries/MySources")
if (EXISTS ${MYSOURCES_SOURCE_DIR})
2021-02-04 15:06:39 +01:00
else()
2021-01-31 22:36:46 +01:00
##MySources
download_project(PROJ MYSOURCES
GIT_REPOSITORY https://gitea-s2i2s.isti.cnr.it/manolas/MySources.git
2020-11-23 10:06:45 +01:00
GIT_TAG master
2020-12-17 21:34:49 +01:00
PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/build/external/
2020-11-23 10:06:45 +01:00
${UPDATE_DISCONNECTED_IF_AVAILABLE}
2021-01-31 22:36:46 +01:00
)
2020-11-23 10:06:45 +01:00
2021-02-04 15:06:39 +01:00
endif()
##Polyscope
#download_project(PROJ POLYSCOPE
# GIT_REPOSITORY https://github.com/nmwsharp/polyscope.git
# GIT_TAG master
# PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/build/external/
# ${UPDATE_DISCONNECTED_IF_AVAILABLE}
#)
#add_subdirectory(${POLYSCOPE_SOURCE_DIR})
#add_compile_definitions(POLYSCOPE_DEFINED)
2020-11-23 10:06:45 +01:00
#dlib
download_project(PROJ DLIB
GIT_REPOSITORY https://github.com/davisking/dlib.git
GIT_TAG master
PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/build/external/
${UPDATE_DISCONNECTED_IF_AVAILABLE}
)
add_subdirectory(${DLIB_SOURCE_DIR})
2020-12-22 17:47:49 +01:00
##vcglib devel branch
download_project(PROJ vcglib_devel
2021-02-04 15:39:27 +01:00
GIT_REPOSITORY https://github.com/IasonManolas/vcglib.git
2020-12-22 17:47:49 +01:00
GIT_TAG devel
PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/build/external/
${UPDATE_DISCONNECTED_IF_AVAILABLE}
)
file(GLOB EXT_SOURCES ${vcglib_devel_SOURCE_DIR}/wrap/ply/plylib.cpp)
2020-11-23 10:06:45 +01:00
##Eigen 3 NOTE: Eigen is required on the system the code is ran
find_package(Eigen3 3.3 REQUIRED)
2021-01-31 22:36:46 +01:00
file(GLOB MYSOURCES ${MYSOURCES_SOURCE_DIR}/*.hpp ${MYSOURCES_SOURCE_DIR}/*.cpp
)
2020-12-22 17:47:49 +01:00
#Add the project sources
file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
2021-01-31 22:36:46 +01:00
if(MSVC)
add_compile_definitions(_HAS_STD_BYTE=0)
endif(MSVC)
add_executable(${PROJECT_NAME} ${SOURCES} ${MYSOURCES} ${EXT_SOURCES} )
2021-01-31 22:36:46 +01:00
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)
2020-11-23 10:06:45 +01:00
target_include_directories(${PROJECT_NAME}
PRIVATE ${vcglib_devel_SOURCE_DIR}
2021-01-31 22:36:46 +01:00
PRIVATE ${MYSOURCES_SOURCE_DIR}
PRIVATE ${MYSOURCES_SOURCE_DIR}/boost_graph
2020-11-23 10:06:45 +01:00
)
2021-01-31 22:36:46 +01:00
link_directories(${MYSOURCES_SOURCE_DIR}/boost_graph/libs)
#target_link_libraries(${PROJECT_NAME} polyscope Eigen3::Eigen matplot dlib::dlib)
target_link_libraries(${PROJECT_NAME} -static Eigen3::Eigen matplot dlib::dlib)