Skip to content

Commit

Permalink
(RelEng) Move code gen and test specific code into appropriate CMake …
Browse files Browse the repository at this point in the history
…structure.
  • Loading branch information
kdesnos committed Sep 6, 2021
1 parent c538eb8 commit fc40dcf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@ include(AddUninstallTarget)

# Add integration tests (unit tests for each library should be in each sublibrary directory).
if(BUILD_TESTING)
add_definitions(-DBIN_DIR_PATH="${CMAKE_CURRENT_BINARY_DIR}")
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/obj ${CMAKE_CURRENT_BINARY_DIR}/buildCodeGen)
add_subdirectory(test)
endif()

Expand Down
5 changes: 5 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ if(result)
message(FATAL_ERROR "Build step for googletest failed: ${result}")
endif()

if(CODE_GEN)
add_definitions(-DBIN_DIR_PATH="${CMAKE_CURRENT_BINARY_DIR}")
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/obj ${CMAKE_CURRENT_BINARY_DIR}/buildCodeGen)
endif()

# Prevent overriding the parent project's compiler/linker
# settings on Windows
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
Expand Down

0 comments on commit fc40dcf

Please sign in to comment.