Skip to content

Commit

Permalink
remove hard coded cgogn path from CMakeLists.
Browse files Browse the repository at this point in the history
one can rename CMakeOptions.txt.sample file to CMakeOptions.txt and
modify the path to cgogn.
This personalized file must not be commited.
  • Loading branch information
lionel untereiner committed May 19, 2017
1 parent bccd16a commit 956b85e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ project(SCHNApps
LANGUAGES CXX
)

#### CGOGN_PATH
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/CMakeOptions.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/CMakeOptions.txt)
else()
message(FATAL_ERROR "No local options file specifying CGOGN directory: CMakeOptions.txt (see CMakeOptions.txt.sample)")
endif()


list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
set(CGAL_DONT_OVERRIDE_CMAKE_FLAGS TRUE CACHE BOOL "preserve cmake flags" FORCE)

Expand All @@ -24,8 +32,6 @@ set(SCHNAPPS_SOURCE_DIR ${SCHNAPPS_PATH})

set(SCHNAPPS_EXEC_NAME schnapps)

#### CGOGN_PATH
set(CGOGN_BUILD_OR_INSTALL_PATH "${SCHNAPPS_PATH}/../CGoGN_2-build" CACHE PATH "CGoGN build or install dir")

if (EXISTS "${CGOGN_BUILD_OR_INSTALL_PATH}")
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${CGOGN_BUILD_OR_INSTALL_PATH})
Expand Down
7 changes: 7 additions & 0 deletions CMakeOptions.txt.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Example of CMakeOptions.txt file

set(CGOGN_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../cgogn)
set(CGOGN_BUILD_DIR ${CGOGN_ROOT_DIR}/build)
set(CGOGN_RELEASE_BUILD_DIR ${CGOGN_BUILD_DIR}/release)
set(CGOGN_DEBUG_BUILD_DIR ${CGOGN_BUILD_DIR}/debug)

0 comments on commit 956b85e

Please sign in to comment.