Refactoring
This commit is contained in:
parent
dd21445f52
commit
01dff95f9d
|
|
@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
|
||||||
project(MySources)
|
project(MySources)
|
||||||
|
|
||||||
file(GLOB MySourcesFiles ${CMAKE_CURRENT_LIST_DIR}/*.hpp ${CMAKE_CURRENT_LIST_DIR}/*.cpp)
|
file(GLOB MySourcesFiles ${CMAKE_CURRENT_LIST_DIR}/*.hpp ${CMAKE_CURRENT_LIST_DIR}/*.cpp)
|
||||||
add_library(${PROJECT_NAME} ${MySourcesFiles} )
|
add_library(${PROJECT_NAME} STATIC ${MySourcesFiles} )
|
||||||
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)
|
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)
|
||||||
|
|
||||||
#Download external dependencies NOTE: If the user has one of these libs it shouldn't be downloaded again.
|
#Download external dependencies NOTE: If the user has one of these libs it shouldn't be downloaded again.
|
||||||
|
|
@ -21,8 +21,8 @@ endif()
|
||||||
file(MAKE_DIRECTORY ${EXTERNAL_DEPS_DIR})
|
file(MAKE_DIRECTORY ${EXTERNAL_DEPS_DIR})
|
||||||
|
|
||||||
set(DRMSimulationModelDir "/home/iason/Coding/Libraries/DRMSimulationModel")
|
set(DRMSimulationModelDir "/home/iason/Coding/Libraries/DRMSimulationModel")
|
||||||
message("drm dir:" ${DRMSimulationModelDir})
|
set(DRMSimulationModelBuildDir ${CMAKE_BINARY_DIR}/_deps)
|
||||||
add_subdirectory(${DRMSimulationModelDir} "/home/iason/Coding/build/DRMSimulationModel")
|
add_subdirectory(${DRMSimulationModelDir} ${DRMSimulationModelBuildDir})
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC DRMSimulationModel)
|
target_link_libraries(${PROJECT_NAME} PUBLIC DRMSimulationModel)
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC ${DRMSimulationModelDir})
|
target_include_directories(${PROJECT_NAME} PUBLIC ${DRMSimulationModelDir})
|
||||||
|
|
||||||
|
|
@ -45,13 +45,17 @@ target_include_directories(${PROJECT_NAME} PUBLIC ${DRMSimulationModelDir})
|
||||||
#add_compile_definitions(DLIB_DEFINED)
|
#add_compile_definitions(DLIB_DEFINED)
|
||||||
|
|
||||||
## polyscope
|
## polyscope
|
||||||
|
#if(NOT TARGET polyscope AND ${USE_POLYSCOPE})
|
||||||
FetchContent_Declare(polyscope
|
FetchContent_Declare(polyscope
|
||||||
GIT_REPOSITORY https://github.com/nmwsharp/polyscope.git
|
GIT_REPOSITORY https://github.com/nmwsharp/polyscope.git
|
||||||
GIT_TAG master
|
GIT_TAG master
|
||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(polyscope)
|
FetchContent_MakeAvailable(polyscope)
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC ${polyscope_SOURCE_DIR}/include)
|
target_include_directories(${PROJECT_NAME} PUBLIC ${polyscope_SOURCE_DIR}/include)
|
||||||
|
# target_include_directories(${PROJECT_NAME} PUBLIC ${polyscope_SOURCE_DIR}/deps/imgui)
|
||||||
|
target_sources(${PROJECT_NAME} PUBLIC ${polyscope_SOURCE_DIR}/deps/imgui/imgui/misc/cpp/imgui_stdlib.h ${polyscope_SOURCE_DIR}/deps/imgui/imgui/misc/cpp/imgui_stdlib.cpp)
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC polyscope)
|
target_link_libraries(${PROJECT_NAME} PUBLIC polyscope)
|
||||||
|
#endif()
|
||||||
#if(NOT TARGET polyscope AND ${USE_POLYSCOPE})
|
#if(NOT TARGET polyscope AND ${USE_POLYSCOPE})
|
||||||
# set(POLYSCOPE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/polyscope)
|
# set(POLYSCOPE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/polyscope)
|
||||||
# download_project(PROJ POLYSCOPE
|
# download_project(PROJ POLYSCOPE
|
||||||
|
|
@ -63,7 +67,6 @@ target_link_libraries(${PROJECT_NAME} PUBLIC polyscope)
|
||||||
# )
|
# )
|
||||||
# add_subdirectory(${POLYSCOPE_SOURCE_DIR} ${POLYSCOPE_BINARY_DIR})
|
# add_subdirectory(${POLYSCOPE_SOURCE_DIR} ${POLYSCOPE_BINARY_DIR})
|
||||||
# add_compile_definitions(POLYSCOPE_DEFINED)
|
# add_compile_definitions(POLYSCOPE_DEFINED)
|
||||||
# target_sources(${PROJECT_NAME} PUBLIC ${POLYSCOPE_SOURCE_DIR}/deps/imgui/imgui/misc/cpp/imgui_stdlib.cpp)
|
|
||||||
|
|
||||||
# message("Using polyscope..")
|
# message("Using polyscope..")
|
||||||
# target_include_directories(${PROJECT_NAME} PUBLIC ${POLYSCOPE_SOURCE_DIR}/include)
|
# target_include_directories(${PROJECT_NAME} PUBLIC ${POLYSCOPE_SOURCE_DIR}/include)
|
||||||
|
|
@ -126,7 +129,7 @@ if(${MYSOURCES_STATIC_LINK})
|
||||||
endif()
|
endif()
|
||||||
if(${MYSOURCES_STATIC_LINK})
|
if(${MYSOURCES_STATIC_LINK})
|
||||||
message("Linking statically here")
|
message("Linking statically here")
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC -static Eigen3::Eigen matplot pthread gfortran quadmath)
|
target_link_libraries(${PROJECT_NAME} PUBLIC #[[-static]] Eigen3::Eigen matplot pthread gfortran quadmath)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC Eigen3::Eigen matplot tbb pthread)
|
target_link_libraries(${PROJECT_NAME} PUBLIC Eigen3::Eigen matplot tbb pthread)
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -179,6 +182,7 @@ download_project(PROJ ENSMALLEN
|
||||||
)
|
)
|
||||||
target_include_directories(${PROJECT_NAME}
|
target_include_directories(${PROJECT_NAME}
|
||||||
PUBLIC ${ENSMALLEN_SOURCE_DIR}/include)
|
PUBLIC ${ENSMALLEN_SOURCE_DIR}/include)
|
||||||
|
message("ens dir:" ${ENSMALLEN_SOURCE_DIR})
|
||||||
add_compile_definitions(USE_ENSMALLEN)
|
add_compile_definitions(USE_ENSMALLEN)
|
||||||
#endif()
|
#endif()
|
||||||
|
|
||||||
|
|
@ -253,5 +257,6 @@ if(NOT TARGET tbb_static AND NOT TARGET tbb)
|
||||||
GIT_TAG master
|
GIT_TAG master
|
||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(tbb)
|
FetchContent_MakeAvailable(tbb)
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE tbb_static)
|
# target_link_libraries(${PROJECT_NAME} PRIVATE tbb_static)
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE tbb)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue