Created
March 21, 2018 12:10
-
-
Save pileon/35eb30777a85938d05f0a4952d8add26 to your computer and use it in GitHub Desktop.
Defining macros in CMake for use in source
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.10) | |
project(Macro) | |
set(CMAKE_CXX_STANDARD 11) | |
add_executable(Macro main.cpp) | |
target_compile_definitions(Macro PUBLIC PATHTOPYTHONSCRIPT=\"${CMAKE_SOURCE_DIR}/bin/postprocessing/extractlinedata.py\") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <limits> | |
int main() | |
{ | |
std::string command = "pvpython " PATHTOPYTHONSCRIPT " -f test_liddrivencavity_re1000-00009.vtu -p1 0.5 0 0 -p2 0.5 1 0"; | |
std::cout << "The command is '" << command << "'\n"; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment