Skip to content

Instantly share code, notes, and snippets.

@ngladitz
Created March 9, 2015 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ngladitz/a2ea8df64ba36bdf1077 to your computer and use it in GitHub Desktop.
Save ngladitz/a2ea8df64ba36bdf1077 to your computer and use it in GitHub Desktop.
cbp Testcase
int main()
{
#ifdef FOO
std::cout << "foo" << std::endl;
#endif
#ifdef BAR
std::cout << "bar" << std::endl;
#endif
}
cmake_minimum_required(VERSION 3.0)
add_executable(foo foo.cpp)
target_compile_definitions(foo PRIVATE FOO)
add_executable(bar bar.cpp)
target_compile_definitions(bar PRIVATE BAR)
int main()
{
#ifdef FOO
std::cout << "foo" << std::endl;
#endif
#ifdef BAR
std::cout << "bar" << std::endl;
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment