Skip to content

Commit

Permalink
Merge pull request #55 from master-csmi/54-update-cmake
Browse files Browse the repository at this point in the history
update CMake for macOS usage #54
  • Loading branch information
pa-senger committed Mar 26, 2024
2 parents 726c979 + 4e74302 commit d3c8db0
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
cmake_minimum_required(VERSION 3.27)
cmake_minimum_required(VERSION 3.22)
# To compile use : cmake --preset debug /path_to_CMakeLists.txt

# project name
project(vegetation)

if( NOT CMAKE_BUILD_TYPE )
set(CMAKE_BUILD_TYPE Release)
endif()


find_package(CGAL REQUIRED)

# Enable generation of compile_commands.json
# set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

Expand All @@ -13,17 +20,12 @@ include_directories(include)
# making the list of sources files
file(GLOB_RECURSE SOURCE_FILES src/*)

# creating the library with the sources files
add_library(${PROJECT_NAME} ${SOURCE_FILES})

# creating the executable from src/main.cpp
add_executable(run src/main.cpp)

target_link_libraries(run CGAL::CGAL)
# linking the executable with the library
target_link_libraries(run ${PROJECT_NAME})

# linkind the executable with the gmp and mpfr libraries for CGAL
target_link_libraries(run gmp mpfr)



Expand All @@ -43,11 +45,3 @@ foreach(TEST_FILES ${TEST_FILES})
add_test(${TEST_NAME} ${TEST_NAME}.out)
message(" - ${TEST_NAME}")
endforeach()








0 comments on commit d3c8db0

Please sign in to comment.