Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,25 @@ if(NOT DEFINED SimpleITKPythonPackage_SUPERBUILD)
set(SimpleITKPythonPackage_SUPERBUILD 1)
endif()

# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
mark_as_advanced(CMAKE_BUILD_TYPE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the project has the languages set to NONE. If this was C++ would we not get these default properties?

endif()

if(SimpleITKPythonPackage_SUPERBUILD)

set(ep_common_cmake_cache_args)
if(NOT CMAKE_CONFIGURATION_TYPES)
list(APPEND ep_common_cmake_cache_args
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
)
endif()

#-----------------------------------------------------------------------------
# Options
option ( SimpleITK_PYTHON_THREADS "Enable threaded python usage by unlocking the GIL." ON )
Expand Down Expand Up @@ -124,6 +141,7 @@ if(SimpleITKPythonPackage_SUPERBUILD)
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
CMAKE_CACHE_ARGS
${ep_common_cmake_cache_args}
-DBUILD_EXAMPLES:BOOL=OFF
-DBUILD_TESTING:BOOL=OFF
-DBUILD_DOXYGEN:BOOL=OFF
Expand Down Expand Up @@ -211,6 +229,7 @@ if(SimpleITKPythonPackage_SUPERBUILD)
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
CMAKE_CACHE_ARGS
${ep_common_cmake_cache_args}
-DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}
-DPYTHON_LIBRARY:PATH=${PYTHON_LIBRARY}
-DPYTHON_EXECUTABLE:PATH=${PYTHON_EXECUTABLE}
Expand Down Expand Up @@ -242,6 +261,7 @@ if(SimpleITKPythonPackage_SUPERBUILD)
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
CMAKE_CACHE_ARGS
${ep_common_cmake_cache_args}
-DSimpleITKPythonPackage_SUPERBUILD:BOOL=0
-DSimpleITK_DIR:PATH=${SimpleITK_DIR}
-DSimpleITK_PYTHON_DIR:PATH=${SimpleITK_PYTHON_DIR}
Expand Down