CMakeLists.txt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. cmake_minimum_required(VERSION 3.0)
  2. project(BLpython3 VERSION 0.0.3)
  3. set(CMAKE_CXX_FLAGS "-static -static-libgcc -static-libstdc++")
  4. set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O2 -DTSFUNCS_DEBUG=false")
  5. set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -Og")
  6. add_definitions(-DPROJECT_NAME="${CMAKE_PROJECT_NAME}")
  7. add_definitions(-DPROJECT_EXPORT=${CMAKE_PROJECT_NAME})
  8. add_definitions(-DPROJECT_VERSION="${CMAKE_PROJECT_VERSION}")
  9. set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
  10. make_directory("${PROJECT_SOURCE_DIR}/generated")
  11. execute_process(
  12. INPUT_FILE "${PROJECT_SOURCE_DIR}/srcPython/bootstrap.py"
  13. COMMAND xxd "-i"
  14. OUTPUT_FILE "${PROJECT_SOURCE_DIR}/generated/include-bootstrap.py"
  15. )
  16. execute_process(
  17. INPUT_FILE "${PROJECT_SOURCE_DIR}/srcPython/test.py"
  18. COMMAND xxd "-i"
  19. OUTPUT_FILE "${PROJECT_SOURCE_DIR}/generated/include-test.py"
  20. )
  21. include_directories("include/" "generated/" "src/" "srcPython/")
  22. add_library(${CMAKE_PROJECT_NAME} SHARED
  23. src/main.cpp
  24. )
  25. set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PREFIX "")
  26. target_link_libraries(${CMAKE_PROJECT_NAME}
  27. psapi
  28. shlwapi
  29. )
  30. set(EXECUTABLE_OUTPUT_PATH ${dir}release)
  31. set(LIBRARY_OUTPUT_PATH ${dir}release)