Skip to content

Commit

Permalink
Migrate CMake files
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <[email protected]>
  • Loading branch information
methylDragon committed Apr 29, 2022
1 parent c489f8d commit 33433c7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ set(IGN_CMAKE_VER ${ignition-cmake3_VERSION_MAJOR})
#============================================================================
# Configure the project
#============================================================================
ign_configure_project(VERSION_SUFFIX pre0)
ign_configure_project(
REPLACE_IGNITION_INCLUDE_PATH gz/plugin
VERSION_SUFFIX pre0)


#============================================================================
Expand Down
3 changes: 2 additions & 1 deletion core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ ign_build_tests(
SOURCES ${tests})


add_subdirectory(include/ignition/plugin)
add_subdirectory(include/gz/plugin)
install(DIRECTORY ignition DESTINATION ${IGN_INCLUDE_INSTALL_DIR_FULL})
6 changes: 3 additions & 3 deletions loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ign_get_libsources_and_unittests(sources tests)

# Disable ign_TEST if ignition-tools is not found
if (MSVC OR NOT IGN_TOOLS_PROGRAM)
list(REMOVE_ITEM tests src/ign_TEST.cc)
list(REMOVE_ITEM tests src/gz_TEST.cc)
endif()

# Create the library target
Expand Down Expand Up @@ -41,11 +41,11 @@ foreach(test ${test_targets})

endforeach()

if(TARGET UNIT_ign_TEST)
if(TARGET UNIT_gz_TEST)
set(_env_vars)
list(APPEND _env_vars "IGN_CONFIG_PATH=${CMAKE_BINARY_DIR}/test/conf/$<CONFIG>")

set_tests_properties(UNIT_ign_TEST PROPERTIES
set_tests_properties(UNIT_gz_TEST PROPERTIES
ENVIRONMENT "${_env_vars}")
endif()

Expand Down
6 changes: 3 additions & 3 deletions loader/conf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Used only for internal testing.
set(ign_library_path "${CMAKE_BINARY_DIR}/test/lib/$<CONFIG>/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")
set(gz_library_path "${CMAKE_BINARY_DIR}/test/lib/$<CONFIG>/ruby/gz/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")

# Generate a configuration file for internal testing.
# Note that the major version of the library is included in the name.
Expand All @@ -13,7 +13,7 @@ file(GENERATE
INPUT "${CMAKE_CURRENT_BINARY_DIR}/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.yaml.configured")

# Used for the installed version.
set(ign_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")
set(gz_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/gz/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")

# Generate the configuration file that is installed.
# Note that the major version of the library is included in the name.
Expand All @@ -24,4 +24,4 @@ configure_file(

# Install the yaml configuration files in an unversioned location.
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.yaml
DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/ignition/)
DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/gz/)
14 changes: 7 additions & 7 deletions loader/src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
add_library(ign STATIC ign.cc)
target_include_directories(ign PUBLIC ${CMAKE_SOURCE_DIR}/loader/include)
target_link_libraries(ign PUBLIC
add_library(gz STATIC gz.cc)
target_include_directories(gz PUBLIC ${CMAKE_SOURCE_DIR}/loader/include)
target_link_libraries(gz PUBLIC
${PROJECT_LIBRARY_TARGET_NAME}
)

set(plugin_executable ign-plugin)
set(plugin_executable gz-plugin)
add_executable(${plugin_executable} plugin_main.cc)
target_link_libraries(${plugin_executable}
ign
ignition-utils${IGN_UTILS_VER}::cli
${loader}
)

set(EXE_INSTALL_DIR "${IGN_LIB_INSTALL_DIR}/ignition/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")
set(EXE_INSTALL_DIR "${IGN_LIB_INSTALL_DIR}/gz/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}")

install(
TARGETS
Expand All @@ -25,7 +25,7 @@ install(
# Generate the ruby script for internal testing.
# Note that the major version of the library is included in the name.
# Ex: cmdplugin2.rb
set(cmd_script_generated_test "${CMAKE_BINARY_DIR}/test/lib/$<CONFIG>/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb")
set(cmd_script_generated_test "${CMAKE_BINARY_DIR}/test/lib/$<CONFIG>/ruby/gz/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb")
set(cmd_script_configured_test "${CMAKE_CURRENT_BINARY_DIR}/test_cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb.configured")

# Set the library_location variable to the full path of the library file within
Expand Down Expand Up @@ -64,4 +64,4 @@ file(GENERATE
INPUT "${cmd_script_configured}")

# Install the ruby command line library in an unversioned location.
install(FILES ${cmd_script_generated} DESTINATION lib/ruby/ignition)
install(FILES ${cmd_script_generated} DESTINATION lib/ruby/gz)

0 comments on commit 33433c7

Please sign in to comment.