Skip to content

Commit

Permalink
Refactor CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Apr 23, 2023
1 parent 5c288a4 commit a4a785a
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
@@ -1,13 +1,14 @@
project(libormaliz_julia)

set(JL_TARGET normaliz_julia)

cmake_minimum_required(VERSION 3.01)
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 @@ -16,15 +17,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 @@ -37,7 +40,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 a4a785a

Please sign in to comment.