Skip to content

Commit

Permalink
Fix and simplify CMakeLists.txt source file glob
Browse files Browse the repository at this point in the history
  • Loading branch information
ZealanL committed Mar 28, 2023
1 parent 12cbccf commit 8b59adc
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@
project("RocketSim")

# Add all headers and code files
file(GLOB_RECURSE FILES_CPP "src/*.cpp")
file(GLOB_RECURSE FILES_H "src/*.h")
file(GLOB_RECURSE FILES_ROCKETSIM "src/*.cpp" "src/*.h")

# Only include bullet headers when using MSVC, otherwise just code files
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
file(GLOB FILES_BULLET "libsrc/bullet3-3.24/*.cpp" "libsrc/bullet3-3.24/*.h")
else()
file(GLOB FILES_BULLET "libsrc/bullet3-3.24/*.cpp")
endif()
file(GLOB_RECURSE FILES_BULLET "libsrc/bullet3-3.24/*.cpp" "libsrc/bullet3-3.24/*.h")

add_library(RocketSim ${FILES_CPP} ${FILES_H} ${FILES_BULLET})
add_library(RocketSim ${FILES_ROCKETSIM} ${FILES_BULLET})

set_target_properties(RocketSim PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(RocketSim PROPERTIES CXX_STANDARD 20)

0 comments on commit 8b59adc

Please sign in to comment.