add possibility to pass options to cmake via setup.py
This commit is contained in:
11
test/extra_cmake_options/cmake/autocmake.cfg
Normal file
11
test/extra_cmake_options/cmake/autocmake.cfg
Normal file
@ -0,0 +1,11 @@
|
||||
[project]
|
||||
name: example
|
||||
|
||||
[cxx]
|
||||
source: ../../../modules/cxx.cmake
|
||||
|
||||
[default_build_paths]
|
||||
source: ../../../modules/default_build_paths.cmake
|
||||
|
||||
[src]
|
||||
source: ../../../modules/src.cmake
|
13
test/extra_cmake_options/src/CMakeLists.txt
Normal file
13
test/extra_cmake_options/src/CMakeLists.txt
Normal file
@ -0,0 +1,13 @@
|
||||
# here we test setting -DENABLE_SOMETHING=OFF -DFOO=ON
|
||||
# setup.py script
|
||||
option(ENABLE_SOMETHING "Enable something" ON)
|
||||
option(ENABLE_FOO "Enable FOO" OFF)
|
||||
|
||||
if(ENABLE_SOMETHING)
|
||||
message(FATAL_ERROR "This test failed")
|
||||
endif()
|
||||
if(NOT ENABLE_FOO)
|
||||
message(FATAL_ERROR "This test failed")
|
||||
endif()
|
||||
|
||||
add_executable(example example.cpp)
|
7
test/extra_cmake_options/src/example.cpp
Normal file
7
test/extra_cmake_options/src/example.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Hello World!";
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user