Skip to content

Commit

Permalink
Refactor CMakeLists.txt (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin authored Mar 20, 2024
1 parent 1e2a341 commit 6e0e2ee
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions deps/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ cmake_minimum_required(VERSION 3.5)

project(libnormaliz_julia)

set(JL_TARGET normaliz_julia)

set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")

find_package(JlCxx REQUIRED)
get_target_property(JlCxx_location JlCxx::cxxwrap_julia LOCATION)
get_filename_component(JlCxx_location ${JlCxx_location} DIRECTORY)

message(STATUS "Found JlCxx at ${JlCxx_location}")

include(CheckCXXCompilerFlag)
Expand All @@ -17,15 +18,17 @@ set(CMAKE_CXX_STANDARD 14)

set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${JlCxx_location}")

include_directories(${gmp_prefix}/include)
include_directories(${normaliz_prefix}/include)
include_directories(${mpfr_prefix}/include)
include_directories(${nauty_prefix}/include)
include_directories(${flint_prefix}/include)
include_directories(
${gmp_prefix}/include
${normaliz_prefix}/include
${mpfr_prefix}/include
${nauty_prefix}/include
${flint_prefix}/include
)

add_library(normaliz_julia SHARED normaliz.cpp)
add_library(${JL_TARGET} SHARED normaliz.cpp)

target_link_libraries(normaliz_julia
target_link_libraries(${JL_TARGET}
JlCxx::cxxwrap_julia
JlCxx::cxxwrap_julia_stl
${libnormaliz_path}
Expand All @@ -38,7 +41,7 @@ target_link_libraries(normaliz_julia
)

install(TARGETS
normaliz_julia
${JL_TARGET}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION lib)

0 comments on commit 6e0e2ee

Please sign in to comment.