Skip to content

Commit 9f6aeb4

Browse files
committed
update following the pull request review
1 parent 413050a commit 9f6aeb4

7 files changed

+60
-64
lines changed

BUILD_INSTRUCTIONS.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
Linux:
22

3-
CMake 3.9 is required.
4-
5-
- a valid installation of gtest is required on your computer:
3+
- CMake 3.9 is required.
4+
- a valid installation of gtest is required on your computer
65

76
```bash
87
## Debug / Release
98
mkdir build
109
cd build
11-
cmake -DMAGMA_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE="Debug" ..
12-
make -j
10+
cmake -DMAGMA_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug ..
11+
make
1312

1413
##! installation
15-
sudo make install -j
14+
sudo make install
1615

1716
##! unit tests
1817
cd build

CMakeLists.txt

+41-41
Original file line numberDiff line numberDiff line change
@@ -36,50 +36,50 @@ endif ()
3636
##! Main library
3737
add_library(magma INTERFACE)
3838

39-
if(NOT DEFINED ENV{CLAWS_ROOT_DEV})
40-
message(STATUS "using insalled version of claws")
41-
find_package(claws CONFIG REQUIRED)
42-
else()
43-
message(STATUS "using development version of claws")
44-
add_subdirectory($ENV{CLAWS_ROOT_DEV} build)
45-
endif()
39+
if (NOT DEFINED ENV{CLAWS_ROOT_DEV})
40+
message(STATUS "using insalled version of claws")
41+
find_package(claws CONFIG REQUIRED)
42+
else ()
43+
message(STATUS "using development version of claws")
44+
add_subdirectory($ENV{CLAWS_ROOT_DEV} build)
45+
endif ()
4646

4747
target_link_libraries(magma INTERFACE
48-
magma::render
49-
claws::utils)
48+
magma::render
49+
claws::utils)
5050

5151
if (NOT IDE_BUILD)
52-
include(GNUInstallDirs)
53-
include(CMakePackageConfigHelpers)
54-
install(TARGETS
55-
magma
56-
EXPORT magma-targets
57-
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
58-
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
59-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
60-
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
61-
)
62-
63-
install(DIRECTORY
64-
${CMAKE_CURRENT_SOURCE_DIR}/modules/magma
65-
DESTINATION
66-
${CMAKE_INSTALL_INCLUDEDIR}
67-
FILES_MATCHING PATTERN "*.h*"
68-
)
69-
70-
install(EXPORT magma-targets
71-
FILE magma-targets.cmake
72-
NAMESPACE magma::
73-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/magma
74-
)
75-
76-
configure_package_config_file(
77-
"${PROJECT_SOURCE_DIR}/cmake/magma-config.cmake.in"
78-
"${PROJECT_BINARY_DIR}/magma-config.cmake"
79-
INSTALL_DESTINATION lib/cmake/magma
52+
include(GNUInstallDirs)
53+
include(CMakePackageConfigHelpers)
54+
install(TARGETS
55+
magma
56+
EXPORT magma-targets
57+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
58+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
59+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
60+
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
61+
)
62+
63+
install(DIRECTORY
64+
${CMAKE_CURRENT_SOURCE_DIR}/modules/magma
65+
DESTINATION
66+
${CMAKE_INSTALL_INCLUDEDIR}
67+
FILES_MATCHING PATTERN "*.hpp"
68+
)
69+
70+
install(EXPORT magma-targets
71+
FILE magma-targets.cmake
72+
NAMESPACE magma::
73+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/magma
74+
)
75+
76+
configure_package_config_file(
77+
"${PROJECT_SOURCE_DIR}/cmake/magma-config.cmake.in"
78+
"${PROJECT_BINARY_DIR}/magma-config.cmake"
79+
INSTALL_DESTINATION lib/cmake/magma
8080
)
8181

82-
install(FILES
83-
"${PROJECT_BINARY_DIR}/magma-config.cmake"
84-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/magma)
85-
endif()
82+
install(FILES
83+
"${PROJECT_BINARY_DIR}/magma-config.cmake"
84+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/magma)
85+
endif ()

cmake/compiler.cmake

+10-10
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ if (UNIX)
1414
set(STANDARD_UNIX_CXX_FLAGS "-Wall -Wextra -Wfatal-errors -Wno-unknown-pragmas")
1515
if (CLANG)
1616
set(STANDARD_UNIX_CXX_FLAGS "${STANDARD_UNIX_CXX_FLAGS} -Weverything -Wno-exit-time-destructors -Wno-covered-switch-default -Wno-documentation-unknown-command -Wno-gnu-zero-variadic-macro-arguments -Wno-global-constructors -Wno-newline-eof -Wno-reserved-id-macro -Wno-deprecated -Wno-padded -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-weak-vtables")
17-
endif()
18-
elseif(MSVC)
17+
endif ()
18+
elseif (MSVC)
1919
set(STANDARD_MSVC_CXX_FLAGS "/std:c++latest /W4 /permissive- /wd4068")
2020
add_definitions(-DNOMINMAX)
21-
endif()
21+
endif ()
2222

2323
##! Internal Debug configuration
2424
macro(__internal_debug_unix_cxx_flags)
@@ -32,9 +32,9 @@ endmacro()
3232
macro(__internal_debug_cxx_flags)
3333
if (CLANG OR GCC)
3434
__internal_debug_unix_cxx_flags()
35-
elseif(MSVC)
35+
elseif (MSVC)
3636
__internal_debug_msvc_cxx_flags()
37-
endif()
37+
endif ()
3838
endmacro()
3939

4040
##! Internal Release configuration
@@ -49,18 +49,18 @@ endmacro()
4949
macro(__internal_release_cxx_flags)
5050
if (CLANG OR GCC)
5151
__internal_release_unix_cxx_flags()
52-
elseif(MSVC)
52+
elseif (MSVC)
5353
__internal_release_msvc_cxx_flags()
54-
endif()
54+
endif ()
5555
endmacro()
5656

5757
##! Compiler Configuration.
58-
if(CMAKE_BUILD_TYPE MATCHES Debug)
58+
if (CMAKE_BUILD_TYPE MATCHES Debug)
5959
add_definitions(-DDEBUG)
6060
__internal_debug_cxx_flags()
6161
MSG_YELLOW_BOLD(STATUS "CMAKE_CXX_FLAGS_DEBUG:" "${CMAKE_CXX_FLAGS_DEBUG}" "")
62-
elseif(CMAKE_BUILD_TYPE MATCHES Release)
62+
elseif (CMAKE_BUILD_TYPE MATCHES Release)
6363
add_definitions(-DRELEASE)
6464
__internal_release_cxx_flags()
6565
MSG_YELLOW_BOLD(STATUS "CMAKE_CXX_FLAGS_RELEASE:" "${CMAKE_CXX_FLAGS_RELEASE}" "")
66-
endif()
66+
endif ()

cmake/library.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ option(TEST_CMAKE_PERSONAL_FEATURES "test personal cmake features" OFF)
22

33
if (TEST_CMAKE_PERSONAL_FEATURES)
44
include(${CMAKE_MODULE_PATH}/test_features.cmake)
5-
endif()
5+
endif ()
66

77
include(buildtype)
88
include(color)

cmake/platform.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
1010
set(ICC TRUE)
1111
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
1212
set(MSVC TRUE)
13-
endif()
13+
endif ()

cmake/unit_tests.cmake

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ macro(__internal_specific_unit_test_platform_configuration EXECUTABLE_NAME)
99
endif (WIN32)
1010
if (CLANG)
1111
set_target_properties(${EXECUTABLE_NAME} PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS} -Wno-global-constructors")
12-
endif()
12+
endif ()
1313
endmacro()
1414

1515
macro(__internal_specific_unit_test_properties EXECUTABLE_NAME)
@@ -34,7 +34,5 @@ macro(CREATE_UNIT_TEST EXECUTABLE_NAME PREFIX_NAME SOURCES)
3434
target_link_libraries(${EXECUTABLE_NAME} GTest::GTest GTest::Main)
3535
__internal_specific_unit_test_platform_configuration(${EXECUTABLE_NAME})
3636
__internal_specific_unit_test_properties(${EXECUTABLE_NAME})
37-
if (NOT EMSCRIPTEN)
38-
gtest_discover_tests(${EXECUTABLE_NAME} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin TEST_PREFIX ${PREFIX_NAME} TIMEOUT 5)
39-
endif()
37+
gtest_discover_tests(${EXECUTABLE_NAME} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin TEST_PREFIX ${PREFIX_NAME} TIMEOUT 5)
4038
endmacro()

modules/.#CMakeLists.txt

-1
This file was deleted.

0 commit comments

Comments
 (0)