set(CMAKE_CONFIGURATION_TYPES "Debug;RelWithAsserts;RelWithDebInfo" CACHE INTERNAL "Build configs")
project(Junction)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
- include(cmake/JunctionProjectDefs.cmake)
- ApplyTurfBuildSettings()
-elseif(NOT JUNCTION_FOUND)
- message(FATAL_ERROR "You must include cmake/JunctionProjectDefs.cmake before adding this subdirectory")
endif()
# Default values, can be overridden by user
set(JUNCTION_ALL_INCLUDE_DIRS "${JUNCTION_INCLUDE_DIRS}")
set(JUNCTION_ALL_LIBRARIES junction)
set(JUNCTION_ALL_DLLS "")
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
-# Add turf targets
+# Add turf targets and import its macros since we use them below
+find_package(Turf REQUIRED)
+include("${TURF_ROOT}/cmake/Macros.cmake")
+if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ # If this is the root project, apply build settings here so that
+ # they're applied to all targets
+ ApplyTurfBuildSettings()
+endif()
add_subdirectory(${TURF_ROOT} turf)
list(APPEND JUNCTION_ALL_INCLUDE_DIRS ${TURF_INCLUDE_DIRS})
list(APPEND JUNCTION_ALL_LIBRARIES ${TURF_ALL_LIBRARIES})
+++ /dev/null
-#---------------------------------------------------------------------------
-# This script is included from the CMakeLists.txt (listfile) of sample applications.
-#---------------------------------------------------------------------------
-
-if(NOT DEFINED PROJECT_NAME)
- message(FATAL_ERROR "project() should be called before including \"${CMAKE_CURRENT_LIST_FILE}\".")
-endif()
-if(NOT DEFINED SAMPLE_NAME)
- message(FATAL_ERROR "SAMPLE_NAME should be set before including \"${CMAKE_CURRENT_LIST_FILE}\".")
-endif()
-
-# Were we included from the root listfile?
-if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
- # Yes, it's the root.
- include("${CMAKE_CURRENT_LIST_DIR}/JunctionProjectDefs.cmake")
- ApplyTurfBuildSettings()
- add_subdirectory(${JUNCTION_ROOT} junction)
-elseif(NOT JUNCTION_FOUND)
- # No, it was added from a parent listfile (via add_subdirectory).
- # The parent is responsible for finding Junction before adding the sample.
- # (Or, Junction's listfile is the root, in which case Junction is already found.)
- message(FATAL_ERROR "JUNCTION_FOUND should already be set when \"${CMAKE_CURRENT_SOURCE_FILE}\" is not the root listfile.")
-endif()
-
-# Define executable target.
-set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.mycompany.\${PRODUCT_NAME:identifier}")
-SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
-GetFilesWithSourceGroups(GLOB SAMPLE_FILES ${CMAKE_CURRENT_SOURCE_DIR} *)
-add_executable(${SAMPLE_NAME} MACOSX_BUNDLE ${SAMPLE_FILES})
-set_target_properties(${SAMPLE_NAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer")
-set_target_properties(${SAMPLE_NAME} PROPERTIES FOLDER samples)
-install(TARGETS ${SAMPLE_NAME} DESTINATION bin)
-
-# Set include dirs and libraries
-include_directories(${JUNCTION_ALL_INCLUDE_DIRS})
-target_link_libraries(${SAMPLE_NAME} ${JUNCTION_ALL_LIBRARIES})
-AddDLLCopyStep(${SAMPLE_NAME} ${JUNCTION_ALL_DLLS})
+++ /dev/null
-# Add cmake/modules to module search path, so subsequent find_package() commands will work.
-list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules")
-
-# FIXME: Implement FindJunction.cmake that other projects can use
-# If this script was invoked from FindJunction.cmake, JUNCTION_ROOT should already be set.
-if(NOT DEFINED JUNCTION_ROOT)
- get_filename_component(JUNCTION_ROOT ${CMAKE_CURRENT_LIST_DIR}/.. ABSOLUTE)
-endif()
-
-set(JUNCTION_FOUND TRUE)
-set(JUNCTION_INCLUDE_DIRS ${JUNCTION_ROOT})
-
-# Find Turf
-if(NOT TURF_FOUND)
- set(TURF_WITH_EXCEPTIONS FALSE CACHE BOOL "Enable compiler support for C++ exceptions")
- find_package(Turf REQUIRED)
-endif()
# You'll want to set the compiler options before calling AddTurfTarget().
#----------------------------------------------
-find_path(TURF_ROOT NAMES "CMakeLists.txt" "cmake/TurfProjectDefs.cmake" PATHS
+find_path(TURF_ROOT "turf/Core.h" PATHS
"${CMAKE_CURRENT_SOURCE_DIR}/../turf"
"${CMAKE_SOURCE_DIR}/../turf"
"${CMAKE_CURRENT_LIST_DIR}/../../../turf")
if(TURF_ROOT)
- include("${TURF_ROOT}/cmake/TurfProjectDefs.cmake")
+ set(TURF_FOUND TRUE)
else()
message("Can't find Turf!")
if(Turf_FIND_REQUIRED)
--- /dev/null
+#---------------------------------------------------------------------------
+# This script is included from the CMakeLists.txt (listfile) of sample applications.
+#---------------------------------------------------------------------------
+
+# Were we included from the root listfile?
+if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ # Yes, it's the root.
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake/modules")
+ find_package(Turf REQUIRED)
+ include("${TURF_ROOT}/cmake/Macros.cmake")
+ ApplyTurfBuildSettings()
+ add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/.." junction)
+endif()
+
+# Define executable target.
+set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.mycompany.\${PRODUCT_NAME:identifier}")
+SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+GetFilesWithSourceGroups(GLOB SAMPLE_FILES ${CMAKE_CURRENT_SOURCE_DIR} *)
+add_executable(${SAMPLE_NAME} MACOSX_BUNDLE ${SAMPLE_FILES})
+set_target_properties(${SAMPLE_NAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer")
+set_target_properties(${SAMPLE_NAME} PROPERTIES FOLDER samples)
+install(TARGETS ${SAMPLE_NAME} DESTINATION bin)
+
+# Set include dirs and libraries
+include_directories(${JUNCTION_ALL_INCLUDE_DIRS})
+target_link_libraries(${SAMPLE_NAME} ${JUNCTION_ALL_LIBRARIES})
+AddDLLCopyStep(${SAMPLE_NAME} ${JUNCTION_ALL_DLLS})
project(${SAMPLE_NAME})
endif()
-include(../../cmake/AddSample.cmake)
+include(../AddSample.cmake)
set(TEST_CHECK_MAP_CONTENTS TRUE CACHE BOOL "Validate contents of the map using its iterator")
set(JUNCTION_USERCONFIG "junction_userconfig.h.in" CACHE STRING "Custom config for ${SAMPLE_NAME}")
-include(../../cmake/AddSample.cmake)
+include(../AddSample.cmake)
project(${SAMPLE_NAME})
endif()
-include(../../cmake/AddSample.cmake)
+include(../AddSample.cmake)
project(${SAMPLE_NAME})
endif()
-include(../../cmake/AddSample.cmake)
+include(../AddSample.cmake)
project(${SAMPLE_NAME})
endif()
-include(../../cmake/AddSample.cmake)
+include(../AddSample.cmake)