You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. project (AsteroGen CXX C)
  2. cmake_minimum_required (VERSION 2.6)
  3. set (CMAKE_CXX_STANDARD 11)
  4. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
  5. FIND_PACKAGE(OpenMP)
  6. if(CMAKE_BUILD_TYPE MATCHES DEBUG)
  7. set(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS}")
  8. endif()
  9. SET(CMAKE_C_FLAGS_RELEASE "-Ofast -msse4 -msse2 -DNDEBUG")
  10. SET(CMAKE_CXX_FLAGS_RELEASE "-Ofast -msse4 -msse2 -DNDEBUG")
  11. if(CMAKE_BUILD_TYPE MATCHES RELEASE)
  12. set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
  13. set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
  14. add_definitions(-DOM_STATIC_BUILD)
  15. endif()
  16. IF(OPENMP_CXX_FOUND)
  17. SET(CMAKE_C_FLAGS "${OpenMP_C_FLAGS} ${CMAKE_C_FLAGS}")
  18. SET(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_CXX_FLAGS} ")
  19. ENDIF()
  20. FIND_PACKAGE(OpenMesh REQUIRED)
  21. link_directories(${OPENMESH_LIBRARY_DIR})
  22. include_directories(${OPENMESH_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/vendor)
  23. # add executable
  24. add_executable(asteroidgen
  25. src/main.cpp
  26. src/Application.cpp
  27. src/Polygoniser.cpp
  28. src/TextureMapper.cpp
  29. src/Mesh.cpp
  30. src/MarchingCube.cpp
  31. src/SkyBox.cpp
  32. src/Shader.cpp
  33. # src/TexturePainter.cpp
  34. # src/gen.cpp
  35. vendor/stb_impl.cpp
  36. vendor/mersenne-twister.cpp
  37. vendor/OpenNL_psm.c
  38. vendor/glad.c
  39. vendor/logger.cpp
  40. vendor/imgui.cpp
  41. vendor/imgui_draw.cpp
  42. vendor/imgui_impl_glfw_gl3.cpp
  43. )
  44. target_link_libraries(asteroidgen ${OPENMESH_LIBRARIES} dl glfw ${OpenMP_CXX_LIBRARIES})
  45. if(CMAKE_BUILD_TYPE MATCHES RELEASE)
  46. set_target_properties(asteroidgen PROPERTIES LINK_SEARCH_START_STATIC 1)
  47. set_target_properties(asteroidgen PROPERTIES LINK_SEARCH_END_STATIC 1)
  48. endif()