add possibility to pass options to cmake via setup.py

This commit is contained in:
Radovan Bast
2015-07-29 22:33:48 +02:00
parent 8b8e95521f
commit cfe2823c09
5 changed files with 41 additions and 0 deletions

View 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

View 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)

View File

@ -0,0 +1,7 @@
#include <iostream>
int main()
{
std::cout << "Hello World!";
return 0;
}