Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify CMakeLists.txt in maps sample to build individually #111

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions P0267_RefImpl/Samples/maps/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
cmake_minimum_required(VERSION 3.0.0)
get_filename_component(SAMPLE_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
get_filename_component(PROJ_DIR ${SAMPLE_DIR} DIRECTORY)
get_filename_component(TOP_DIR ${PROJ_DIR} DIRECTORY)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${TOP_DIR}/cmake)
set(CMAKE_CXX_STANDARD 17)

# Use the CMakeLists.txt's parent-directory-name for the project's id/name
get_filename_component(PROJECT_ID ${CMAKE_CURRENT_SOURCE_DIR} NAME)
string(REPLACE " " "_" PROJECT_ID ${PROJECT_ID})
project(${PROJECT_ID})

find_package(Boost 1.67.0 QUIET COMPONENTS system date_time)
find_package(io2d REQUIRED)
find_package(Cairo)
find_package(GraphicsMagick)


if( NOT Boost_FOUND )
message( "Skipping the Maps example since Boost was not found" )
Expand All @@ -16,10 +30,6 @@ endif()

add_subdirectory(external/pugixml)

# Use the CMakeLists.txt's parent-directory-name for the project's id/name
get_filename_component(PROJECT_ID ${CMAKE_CURRENT_SOURCE_DIR} NAME)
string(REPLACE " " "_" PROJECT_ID ${PROJECT_ID})
project(${PROJECT_ID})

add_executable(${PROJECT_ID}
main.cpp
Expand All @@ -32,7 +42,7 @@ add_executable(${PROJECT_ID}
)

target_link_libraries(${PROJECT_ID}
io2d
PRIVATE io2d::io2d
pugixml
${Boost_LIBRARIES}
${OPENSSL_LIBRARIES}
Expand All @@ -43,7 +53,7 @@ target_include_directories(${PROJECT_ID} SYSTEM
)

if( ${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
target_link_libraries(${PROJECT_ID} pthread)
target_link_libraries(${PROJECT_ID} PUBLIC pthread)
endif()

if(MSVC)
Expand Down