-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
81 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,34 @@ | ||
|
||
set( static_library_name ${ARGUMENTUM_STATIC_NAME} ) | ||
set( internal_library_name ${ARGUMENTUM_INTERNAL_NAME} ) | ||
set( target_list_name ${PROJECT_NAME}Targets ) | ||
|
||
add_library( ${static_library_name} STATIC | ||
# The published static library | ||
if ( BUILD_STATIC_LIBS ) | ||
add_library( ${static_library_name} STATIC | ||
argparser.cpp | ||
) | ||
if( ARGUMENTUM_PEDANTIC ) | ||
target_compile_options( ${static_library_name} PRIVATE | ||
$<$<CXX_COMPILER_ID:GNU>:-Werror -Wall> | ||
$<$<CXX_COMPILER_ID:MSVC>:/WX /permissive- /Za> | ||
) | ||
endif() | ||
|
||
install( TARGETS ${static_library_name} | ||
EXPORT ${target_list_name} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
) | ||
endif() | ||
|
||
# The static library used for internal purposes: instutil, tests, examples. | ||
add_library( ${internal_library_name} STATIC | ||
argparser.cpp | ||
) | ||
if( ARGUMENTUM_PEDANTIC ) | ||
target_compile_options( ${static_library_name} PRIVATE | ||
target_compile_options( ${internal_library_name} PRIVATE | ||
$<$<CXX_COMPILER_ID:GNU>:-Werror -Wall> | ||
$<$<CXX_COMPILER_ID:MSVC>:/WX /permissive- /Za> | ||
) | ||
endif() | ||
|
||
install( TARGETS ${static_library_name} | ||
EXPORT ${target_list_name} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
|
||
include_directories( ../../include ) | ||
if ( BUILD_STATIC_LIBS ) | ||
include_directories( ../../include ) | ||
|
||
find_package( GTest REQUIRED ) | ||
find_package( Threads REQUIRED ) | ||
find_package( GTest REQUIRED ) | ||
find_package( Threads REQUIRED ) | ||
|
||
add_executable( staticLibraryTest | ||
runtest.cpp | ||
../testutil.cpp | ||
basic_command_t.cpp | ||
) | ||
add_executable( staticLibraryTest | ||
runtest.cpp | ||
../testutil.cpp | ||
basic_command_t.cpp | ||
) | ||
|
||
target_link_libraries( staticLibraryTest | ||
${GTEST_LIBRARIES} | ||
${CMAKE_THREAD_LIBS_INIT} | ||
${ARGUMENTUM_STATIC_NAME} | ||
) | ||
add_dependencies( staticLibraryTest ${ARGUMENTUM_STATIC_NAME} ) | ||
|
||
add_test( | ||
NAME | ||
staticlib | ||
COMMAND | ||
${CMAKE_BINARY_DIR}/test/staticlib/staticLibraryTest | ||
) | ||
target_link_libraries( staticLibraryTest | ||
${GTEST_LIBRARIES} | ||
${CMAKE_THREAD_LIBS_INIT} | ||
${ARGUMENTUM_STATIC_NAME} | ||
) | ||
add_dependencies( staticLibraryTest ${ARGUMENTUM_STATIC_NAME} ) | ||
|
||
add_test( | ||
NAME | ||
staticlib | ||
COMMAND | ||
${CMAKE_BINARY_DIR}/test/staticlib/staticLibraryTest | ||
) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters