Skip to content

Commit

Permalink
Correcting defective check for AUTOWIRING_IS_EMBEDDED
Browse files Browse the repository at this point in the history
  • Loading branch information
codemercenary committed Aug 18, 2014
1 parent 17838ae commit cb02634
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ set(autowiring_VERSION_MINOR 1)
set(autowiring_VERSION_PATCH 0)

# Determine whether Autowiring has been embedded in another project
set(AUTOWIRING_IS_EMBEDDED (CMAKE_SOURCE_DIR STREQUAL AUTOWIRING_ROOT_DIR))
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(AUTOWIRING_IS_EMBEDDED)
else()
set(AUTOWIRING_IS_EMBEDDED "TRUE")
endif()

# If there's an external libraries directory path, use it as a search prefix
if(EXTERNAL_LIBRARY_DIR)
Expand Down Expand Up @@ -61,16 +65,16 @@ set(AUTOWIRING_BUILD_AUTONET_DEFAULT ON)
# can always set the AUTOWIRING_BUILD_TESTS flag
get_filename_component(AUTOWIRING_ROOT_DIR . ABSOLUTE)
if(AUTOWIRING_IS_EMBEDDED)
set(AUTOWIRING_BUILD_TESTS_DEFAULT OFF)
set(AUTOWIRING_BUILD_EXAMPLES_DEFAULT OFF)
else()
set(AUTOWIRING_BUILD_TESTS_DEFAULT ON)
set(AUTOWIRING_BUILD_EXAMPLES_DEFAULT ON)

# All of our binaries go to one place: The binaries output directory. We only want to tinker
# with this if we're building by ourselves, otherwise we just do whatever the enclosing project
# wants us to do.
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
else()
set(AUTOWIRING_BUILD_TESTS_DEFAULT OFF)
set(AUTOWIRING_BUILD_EXAMPLES_DEFAULT OFF)
endif()

option(AUTOWIRING_BUILD_TESTS "Build Autowiring unit tests" ${AUTOWIRING_BUILD_TESTS_DEFAULT})
Expand Down

0 comments on commit cb02634

Please sign in to comment.